﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Runtime.Serialization;

namespace Airport
{
    [DataContract]
    public class RouteNode : Node, IEquatable<RouteNode>
    {

        private DateTime _predictedTOA;
        private DateTime _actualTOA;
        private DateTime _expireTime;

        public RouteNode()
            : base()
        {
        }

        public RouteNode(int id, int x, int y)
            : base(id, x, y)
        {
        }

        [DataMember]
        public DateTime PredictedTOA
        {
            get
            {
                return _predictedTOA;
            }

            set
            {
                if (_predictedTOA != value)
                {
                    _predictedTOA = value;
                }
            }
        }

        [DataMember]
        public DateTime ActualTOA
        {
            get
            {
                return _actualTOA;
            }

            set
            {
                if (_actualTOA != value)
                {
                    _actualTOA = value;
                }
            }
        }

        [DataMember]
        public DateTime ExpireTime
        {
            get
            {
                return _expireTime;
            }

            set
            {
                if (_expireTime != value)
                {
                    _expireTime = value;
                }
            }
        }

        public bool Equals(RouteNode other)
        {
            if (other == null)
            {
                return false;
            }
            /*
            if (!base.Equals((Node)other))
            {
                return false;
            }*/

            if (_predictedTOA != other._predictedTOA)
            {
                return false;
            }

            if (_actualTOA != other._actualTOA)
            {
                return false;
            }

            if (_expireTime != other._expireTime)
            {
                return false;
            }

            return true;
        }
    }
}